<layout name="master"/>
<script src="__PUBLIC__/js/jquery.min.js"></script>
<script src="__PUBLIC__/uploadify/jquery.uploadify.js"></script>
<link rel="stylesheet" href="__PUBLIC__/uploadify/uploadify.css">
<ul class="breadcrumb no-border no-radius b-b b-light pull-in">
    <li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
    <li><a href="#">品牌管理</a></li>
    <li class="active">品牌添加</li>
</ul>
<div class="col-sm-12">
    <section class="panel panel-default">
        <header class="panel-heading font-bold">品牌添加</header>
        <div class="panel-body">
            <form method="post" action="" class="bs-example form-horizontal" enctype="multipart/form-data">
                <div class="form-group">
                    <label class="col-lg-2 control-label">品牌名称</label>
                    <div class="col-lg-10">
                        <input type="text" class="form-control" name="bname">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">logo</label>
                    <div class="col-lg-10">
                        <input type="file" name="logo" id="upFile">
                        <!--<input type="file" name="testThinkUpload" id="">-->
                    </div>
                    <div class="row" id="uploadBox">

                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">排序</label>
                    <div class="col-lg-10">
                        <input type="text" class="form-control" name="sort">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">是否显示</label>
                    <div class="col-lg-10">
                        <div class="radio">
                            <label>
                                <input type="radio" name="isshow"  value="1" checked> 是
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="isshow"  value="0"> 否
                            </label>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-lg-offset-2 col-lg-10">
                        <button type="submit" class="btn btn-sm btn-default">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </section>
</div>
</div>
<style>
    .bgred{
        background: red;
    }
</style>
<script>
    $(function() {
        $("#upFile").uploadify({
            buttonText : '上传',
            buttonClass : 'bgred',
            height        : 30,
            swf           : '__PUBLIC__/uploadify/uploadify.swf',
            uploader      : "{:u('admin/brand/ajaxUpload',['tpl'=>'uploadTpl'])}",
            width         : 120,
            onUploadSuccess : function(file, data, response) {
                $('#uploadBox').append(data);
            }
        });
    });

</script>